package com.fy.merchant.controller;

import com.fy.common.api.CommonResult;
import com.fy.merchant.common.vo.IdAndMerchantid;
import com.fy.merchant.reqvo.CommodityCreateVo;
import com.fy.merchant.reqvo.CommodityUpdateVo;
import com.fy.merchant.reqvo.QueryPublishVo;
import com.fy.merchant.resvo.CategoryVo;
import com.fy.merchant.resvo.CommodityIdVo;
import com.fy.merchant.resvo.SpecificationVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;

@RestController
@Api(tags = "发布商品")
@RequestMapping("issue")
public class ReleaseCommoditiesController {
    @ApiOperation("查询所有")
    @GetMapping(value = "findAll")
    public CommonResult findAll(@RequestBody QueryPublishVo queryPublishVo) {
        return CommonResult.success(queryPublishVo);
    }

    @ApiOperation("id查询")
    @GetMapping(value = "findId")
    public CommonResult findId(@RequestBody IdAndMerchantid idAndMerchantid) {
        CommodityIdVo commodityIdVo = null;
        return CommonResult.success(commodityIdVo);
    }

    @ApiOperation("创建商品")
    @PostMapping(value = "create")
    public CommonResult create(@RequestBody CommodityCreateVo commodityCreateVo) {
        return CommonResult.success();
    }

    @ApiOperation("删除商品")
    @DeleteMapping(value = "delete")
    public CommonResult delete(@RequestBody IdAndMerchantid idAndMerchantid) {
        return CommonResult.success();
    }

    @ApiOperation("更新商品")
    @PostMapping(value = "update")
    public CommonResult update(@RequestBody CommodityUpdateVo commodityUpdateVo) {
        return CommonResult.success();
    }

    @ApiOperation("商品类别")
    @GetMapping(value = "category")
    public CommonResult findCategory() {
        return CommonResult.success(new ArrayList<CategoryVo>());
    }

    @ApiOperation("商品规格")
    @GetMapping(value = "specification")
    public CommonResult findSpecification(Integer id) {
        return CommonResult.success(new ArrayList<SpecificationVo>());
    }

}
